package com.qf.exception;

import java.io.FileInputStream;
import java.io.FileNotFoundException;

public class CatchExceptMethod {
	
	public static void main(String[] args) {
		//捕获异常，具体异常写对应的方法和名称
		try {
			FileInputStream file = new FileInputStream("");
			int i = 2/0;
			
		}
		//只会报一个错误，类似if elseif
		//大异常写后面
		catch(FileNotFoundException e){
			System.out.println("文件没找到！");
		}
		catch (ArithmeticException e) {
			System.out.println("计算错误！");
		}
		catch (Exception e) {
			// TODO: handle exception
			System.out.println("位置错误！");
			
		}
		
		System.out.println("程序执行结束！");
	}

}
